function obj = addPlot(objS,p,varargin)
 
if isempty(varargin)
    objS.plotting(length(objS.data)+1)=p;
else
    objS.plotting(varargin{1})=p;
end
if isa(objS,'spectra')
    obj=objS;
else
    obj=spectra(objS);
end
